<template>
  <div class="article-container">
    <el-card class="filter-card" v-for="(i,$index) in dataslist" :key="$index">
      <div slot="header" class="headers clearfix">
        <div class="left_spen">
          <img v-if="i.create_user_info.thumb_img" :src="i.create_user_info.thumb_img" alt />
          <i v-else class="covers">{{i.log_id}}</i>
        </div>
        <div class="right_txt">
          <span>{{i.create_user_info.realname}}</span>
          <b>{{i.is_read ==1?'已读':'未读'}}</b>
          <i>{{i.create_time|dateFilter}} {{i.update_time|updattime}}</i>
        </div>
        <el-button style="float: right; padding: 3px 0" type="text">...</el-button>
      </div>
      <div class="jobtext">
        <p>
          <span>今日工作内容:</span>
          {{i.content}}
        </p>
        <p>
          <span>明日工作内容:</span>
          {{i.tomorrow}}
        </p>
      </div>
      <footer></footer>
    </el-card>
  </div>
</template>

<script>
import Vue from "vue";
import http from "@/util/http.js";
import moment from "moment";
Vue.filter("dateFilter", (date) => {
  return moment(date * 1000).format("YYYY-MM-DD");
});
Vue.filter("updattime", (date) => {
  return moment().format("HH:mm:ss");
});
export default {
  name: "cards_rz",
  data() {
    return {
      dataslist: [],
    };
  },
  methods: {
    imgError(i) {
      i.create_user_info.thumb_img = require("../imger/notfound.jpg");
    },
  },

  mounted() {
    http.post("oa/log/index").then((res) => {
      console.log(res.data.data.list);
      this.dataslist = res.data.data.list;
    });
  },
  components: {},
};
</script>

<style scoped lang='scss'>
.article-container {
  margin-top: 10px;
  height: 500px;
  overflow-y: scroll;
}
.filter-card {
  margin: 20px 0;
}
.headers {
  display: flex;
  .left_spen {
    width: 35px;
    height: 35px;
    margin-right: 20px;
    overflow: hidden;
    border-radius: 50%;
    img {
      width: 100%;
      height: 100%;
    }
    .covers {
      width: 35px;
      height: 35px;
      border-radius: 50%;
      overflow: hidden;
      margin-right: 20px;
      float: left;
      text-align: center;
      line-height: 35px;
      background: royalblue;
      color: #fff;
      font-style: normal;
    }
  }
  .right_txt {
    width: 700px;

    span {
      font-size: 15px;
      margin: 0 10px 0 0;
      color: #333;
      display: inline-block;
    }
    i {
      display: block;
      color: #999;
      font-size: 12px;
      font-style: normal;
    }
    b {
      font-weight: normal;
      color: #999;
      font-size: 12px;
    }
  }
}
.jobtext {
  p {
    margin-bottom: 7px;
    line-height: 22px;
    font-size: 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
    span {
      width: 95px;
      text-align: left;
      display: inline-block;
      color: #999;
      font-size: 13px;
    }
  }
}
footer {
  height: 30px;
  background: #f4f7fd;
  width: 100%;
}
</style>
